﻿using System;
using System.Reflection;
using log4net;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace SBACN.WebSite.Common
{
	public class Log
	{
		public static readonly Log Instance = new Log();
		private Log()
		{ }
		private ILog logInstance = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
		//private ILog logInstance = LogManager.GetLogger("DefaultInstance");

		public void WriteErrorLog(object log, Exception ex)
		{
			logInstance.Error(log, ex);
		}

		public void WirteInfoLog(object log)
		{
			logInstance.Info(log);
		}

		public void WirteDebugLog(object log)
		{
			logInstance.Debug(log);
		}

		public void WirteWarnLog(object log)
		{
			logInstance.Warn(log);
		}

		public void WirteFatalLog(object log)
		{
			logInstance.Fatal(log);
		}
	}
}